:root {
  /* 主色调 */
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #a5b4fc;
  
  /* 背景色 */
  --bg: #f8fafc;
  --bg-secondary: #f1f5f9;
  --card: #ffffff;
  --card-hover: #fefefe;
  
  /* 文字颜色 */
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  
  /* 边框和分割线 */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  
  /* 状态颜色 */
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  
  /* 阴影 */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  
  /* 圆角 */
  --radius-sm: 0.375rem;
  --radius: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  font-weight: 400;
  color-scheme: light;
  color: var(--text-primary);
  background-color: var(--bg);

  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  font-weight: 500;
  color: #646cff;
  text-decoration: inherit;
}
a:hover {
  color: #535bf2;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  background-color: var(--primary);
  color: white;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:focus,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button.secondary {
  background-color: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

button.secondary:hover {
  background-color: var(--bg-secondary);
  transform: none;
  box-shadow: none;
}

.card {
  padding: 1.5rem;
  background: var(--card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  transition: all 0.2s ease-in-out;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  background: var(--card-hover);
}

#app { width:100% }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: none;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s ease-in-out;
}

.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn.ghost {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn.ghost:hover {
  background: var(--primary);
  color: white;
}

.btn.sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
}

.btn.lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table th,
.table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.table thead th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.table tbody tr:hover {
  background: var(--bg-secondary);
}

.table tbody tr:last-child td {
  border-bottom: none;
}


@media (prefers-color-scheme: light) {
  :root {
    color: #213547;
    background-color: #ffffff;
  }
  a:hover {
    color: #747bff;
  }
  button {
    background-color: #f9f9f9;
  }
}

/* Layout for admin */
html, body, #app { 
  height: 100%; 
  margin: 0;
  padding: 0;
}

body { 
  background: var(--bg); 
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
}

#app {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100vh;
  background: var(--bg);
}

.content {
  padding: 0;
  flex: 1;
}

.page {
  width: 100%;
}

/* 页面标题 */
.page h1, .page h2 {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 1.5rem;
  font-size: 1.875rem;
}

.page h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* 状态标签 */
.status {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status.success {
  background: #dcfce7;
  color: #166534;
}

.status.warning {
  background: #fef3c7;
  color: #92400e;
}

.status.error {
  background: #fee2e2;
  color: #991b1b;
}

.status.info {
  background: #dbeafe;
  color: #1e40af;
}

/* 输入框 */
.input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-primary);
  font-size: 0.875rem;
  transition: all 0.2s ease-in-out;
}

.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 动画效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 页面进入动画 */
.page {
  animation: fadeIn 0.6s ease-out;
}

.card {
  animation: scaleIn 0.4s ease-out;
}

/* 按钮悬停效果增强 */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

/* 表格行悬停效果 */
.table tbody tr {
  transition: all 0.2s ease-in-out;
}

.table tbody tr:hover {
  background: var(--bg-secondary);
  transform: scale(1.01);
}

/* 卡片悬停效果增强 */
.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

/* 输入框聚焦效果 */
.input:focus,
.search-input:focus,
.filter-select:focus {
  transform: scale(1.02);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --card: #1e293b;
    --card-hover: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border: #334155;
    --border-light: #475569;
  }
  
  .sidebar {
    background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  }
  
  .topbar {
    background: var(--card);
    border-bottom-color: var(--border);
  }
}

